<?php include THEMES_PATH.'public/before_body2.phtml';?>
<link href="/statics/front/css/product.css" rel="stylesheet">
</head>
<body>
<?php include THEMES_PATH.'public/header2.phtml';?>
<div class="main-width">
  <div class="row fabrics-kit-heading">
    <div class="col-sm-3 col-md-2"><img src="<?php echo $productinfo['goods_img'];?>" alt="商品图片"></div>
    <div class="col-sm-9 col-md-10">
      <strong class="title"><?php echo $productinfo['name'];?></strong>
      <div class="review">
        <?php
        if($productComment['star'] > 0):
          ?>
          <span class="comment-star">
          <?php
          if($productComment['star'] == 0) $productComment['star'] = 5;
          for($star=0;$star<$productComment['star'];$star++):
            ?>
            <span class="fa fa-star"></span>
          <?php endfor;?>
            <?php for($star=0;$star<(5-$productComment['star']);$star++):?>
              <span class="fa fa-star-o"></span>
            <?php endfor;?>
        </span>
        <?php endif;?>
        <span>(<a class="comment-num" href="#product-comment"><?php if($productComment['count'] <= 0){echo L('No_review');}else if($productComment['count'] == 1){echo $productComment['count'].' '.L('Customer_Review');}else{echo $productComment['count'].' '.L('Customer_Reviews');}?></a>)</span>
      </div>
      <span class="title"><?php echo currency($productinfo['advanced_price']);?></span>
      <p class="text"><?php echo $productinfo['summary'];?></p>
    </div>
  </div>
</div>
<?php
  if(isset($productList) && $productList){
?>
<div class="fabrics-kit-nav js-tab-nav">
  <ul class="clearfix main-width">
    <li class="current"><?php echo L('_regular_suit_');?><i class="fa fa-caret-up"></i></li>
    <li><?php echo L('_premium_suit_');?><i class="fa fa-caret-up"></i></li>
    <li><?php echo L('_BLAZERS_');?><i class="fa fa-caret-up"></i></li>
    <li><?php echo L('_SHIRTS_');?><i class="fa fa-caret-up"></i></li>
    <li><?php echo L('_VESTS_');?><i class="fa fa-caret-up"></i></li>
    <li><?php echo L('_PANTS_');?><i class="fa fa-caret-up"></i></li>
    <li><?php echo L('_COATS_');?><i class="fa fa-caret-up"></i></li>
  </ul>
</div>
<div class="main-width clearfix">
  <div class="row">
    <div class="col-md-3 col-sm-4 col-md-push-9 col-sm-push-8">
      <div class="mb2x fabrics-kit-swatches js-swatches">
        <strong><?php echo L('_Swatches_');?></strong>
        <ol>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
        </ol>
        <form action="<?php echo url('Cart/fabricsAdd');?>" method="post"		data-submit="ajax">
          <input type="hidden" name="customization" value="" />
          <button type="submit" name="dosubmit" id="submitSelectedFabrics" value="1" class="btn btn-middle" disabled><?php echo L('ADD_TO_CART');?></button>
        </form>
      </div>
    </div>
    <div class="col-md-9 col-sm-8 col-md-pull-3 col-sm-pull-4 fabrics-kit-products">
      <div class="row fabrics-kit-list js-tab-content">
        <ul class="show">
          <?php
            foreach ($productList as $key => $product){
          ?>
          <?php $product['photoList'] = ProductModel::get_product_photo_list($product['id']);?>
          <li data-id="Fabric<?php echo $product['sn']?>"
              data-href="<?php echo $product['url']?>"
              data-desc="<?php echo htmlspecialchars($product['content'])?>">
            <img data-original="<?php echo $product['goods_img']?>" data-src="<?php echo(end($product['photoList'])['img']);?>" alt="<?php echo $product['name']?>" />
            <?php if(!empty($product['ml_img'])){ ?><img src="<?php echo $product['ml_img']?>" class="hide"><?php } ?>
            <p><?php echo $product['name']?></p>
            <i></i>
          </li>
          <?php
          };
          ?>
        </ul>
        <ul>
          <?php
            foreach ($premiumList as $key => $product){
          ?>
          <?php $product['photoList'] = ProductModel::get_product_photo_list($product['id']);?>
          <li data-id="Fabric<?php echo $product['sn']?>"
              data-href="<?php echo $product['url']?>"
              data-desc="<?php echo htmlspecialchars($product['content'])?>">
            <img data-original="<?php echo $product['goods_img']?>" data-src="<?php echo(end($product['photoList'])['img']);?>" alt="<?php echo $product['name']?>" />
            <?php if(!empty($product['ml_img'])){ ?><img src="<?php echo $product['ml_img']?>" class="hide"><?php } ?>
            <p><?php echo $product['name']?></p>
            <i></i>
          </li>
          <?php
          };
          ?>
        </ul>
        <!--单西-->
        <ul>
          <?php
          foreach ($blazersProduct as $key => $product){
            ?>
            <?php $product['photoList'] = ProductModel::get_product_photo_list($product['id']);?>
            <li data-id="Fabric<?php echo $product['sn']?>"
                data-href="<?php echo $product['url']?>"
                data-desc="<?php echo htmlspecialchars($product['content'])?>">
              <img data-original="<?php echo $product['goods_img']?>" data-src="<?php echo(end($product['photoList'])['img']);?>" alt="<?php echo $product['name']?>" />
              <?php if(!empty($product['ml_img'])){ ?><img src="<?php echo $product['ml_img']?>" class="hide"><?php } ?>
              <p><?php echo $product['name']?></p>
              <i></i>
            </li>
          <?php
          };
          ?>
        </ul>
        <!--高端西服-->
        <ul>
          <?php
          foreach ($shirtsproduct as $key => $product){
            ?>
            <?php $product['photoList'] = ProductModel::get_product_photo_list($product['id']);?>
            <li data-id="Fabric<?php echo $product['sn']?>"
                data-href="<?php echo $product['url']?>"
                data-desc="<?php echo htmlspecialchars($product['content'])?>">
              <img data-original="<?php echo $product['goods_img']?>" data-src="<?php echo(end($product['photoList'])['img']);?>" alt="<?php echo $product['name']?>" />
              <?php if(!empty($product['ml_img'])){ ?><img src="<?php echo $product['ml_img']?>" class="hide"><?php } ?>
              <p><?php echo $product['name']?></p>
              <i></i>
            </li>
          <?php
          };
          ?>
        </ul>
        <!--马夹-->
        <ul>
          <?php
          foreach ($vestsProduct as $key => $product){
            ?>
            <?php $product['photoList'] = ProductModel::get_product_photo_list($product['id']);?>
            <li data-id="Fabric<?php echo $product['sn']?>"
                data-href="<?php echo $product['url']?>"
                data-desc="<?php echo htmlspecialchars($product['content'])?>">
              <img data-original="<?php echo $product['goods_img']?>" data-src="<?php echo(end($product['photoList'])['img']);?>" alt="<?php echo $product['name']?>" />
              <?php if(!empty($product['ml_img'])){ ?><img src="<?php echo $product['ml_img']?>" class="hide"><?php } ?>
              <p><?php echo $product['name']?></p>
              <i></i>
            </li>
          <?php
          };
          ?>
        </ul>
        <!--裤子-->
        <ul>
          <?php
          foreach ($pantsProduct as $key => $product){
            ?>
            <?php $product['photoList'] = ProductModel::get_product_photo_list($product['id']);?>
            <li data-id="Fabric<?php echo $product['sn']?>"
                data-href="<?php echo $product['url']?>"
                data-desc="<?php echo htmlspecialchars($product['content'])?>">
              <img data-original="<?php echo $product['goods_img']?>" data-src="<?php echo(end($product['photoList'])['img']);?>" alt="<?php echo $product['name']?>" />
              <?php if(!empty($product['ml_img'])){ ?><img src="<?php echo $product['ml_img']?>" class="hide"><?php } ?>
              <p><?php echo $product['name']?></p>
              <i></i>
            </li>
          <?php
          };
          ?>
        </ul>
        <!--大衣-->
        <ul>
          <?php
          foreach ($coatsProduct as $key => $product){
            ?>
            <?php $product['photoList'] = ProductModel::get_product_photo_list($product['id']);?>
            <li data-id="Fabric<?php echo $product['sn']?>"
                data-href="<?php echo $product['url']?>"
                data-desc="<?php echo htmlspecialchars($product['content'])?>">
              <img data-original="<?php echo $product['goods_img']?>" data-src="<?php echo(end($product['photoList'])['img']);?>" alt="<?php echo $product['name']?>" />
              <?php if(!empty($product['ml_img'])){ ?><img src="<?php echo $product['ml_img']?>" class="hide"><?php } ?>
              <p><?php echo $product['name']?></p>
              <i></i>
            </li>
          <?php
          };
          ?>
        </ul>
      </div>
      <!--评论列表-->
      <div id="product-comment" class="product-comment">
        <div class="heading product-comment-title"><strong><?php echo L('Customer_Reviews'); ?></strong></div>
        <?php if ($productComment['count'] < 1): ?>
          <div class="no-comment align-center">
            <?php echo L('No_reviews_here'); ?>
          </div>
        <?php endif; ?>
      </div>
    </div>
  </div>
</div>
<div class="back-top js-back-top"></div>
<div class="popup-box swatch-popup js-swatch-popup">
  <div class="col-sm-6"><img src="<?php echo $product['ml_img']?>" alt="swatch" /></div>
  <div class="col-sm-6 font-md">
    <strong></strong>
    <a class="link-detail" href="<?php echo $product['url'];?>"><?php echo L('View_Product');?> &gt;</a>
    <ul></ul>
    <span class="btn btn-middle mt1x js-add-swatch"><?php echo L(ADD_SWATCH);?></span>
  </div>
  <i class="close js-close">×</i>
</div>
<?php } ?>
<?php include THEMES_PATH.'public/footer2.phtml';?>
<script src="/statics/front/js/plugins/jquery.lazyload.js"></script>
<script src="/statics/front/js/scripts/fabrics/fabrics.js"></script>
<script>
var _init = false;
function customerReviews(page) {
$.ajax({
  type: 'GET',
  url: '/product/reviews',
  data: {'pid':'505', 'p': page},
  success: function (content) {
	if(_init)
	  $(".comment-num").trigger("click");
	_init = true;
	$('.product-comment-title').nextAll().remove();
	$('.product-comment-title').after(content);
  }
})
}
<?php if($productComment['count'] > 0):?>
customerReviews(1, function () {
  $(".comment-num").trigger("click");
});
<?php endif;?>
</script>
<?php include THEMES_PATH.'public/after_body.phtml';?>